package com.damon.android.interview.service;

import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.util.Log;

/**
 * Created by Damon.Han on 2018/10/11 0011.
 *
 * @author Damon
 */
public class Service2 extends Service {
    String TAG = getClass().getName();

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        Log.d(TAG, "onBind");
        return new MyBinder();
    }

    class MyBinder extends Binder {
        public void showLog() {
            Log.e("MyBinder", "showLog");
        }
    }

    @Override
    public boolean onUnbind(Intent intent) {
        Log.e("Service2", "showLog");
        return super.onUnbind(intent);
    }
}
